package org.bronycorps.mlptss.domain.layer;

import org.bronycorps.mlptss.manager.CommonAssetManager;
import org.bronycorps.mlptss.manager.preferences.GameConfiguration;
import org.bronycorps.mlptss.screen.LevelScreen;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle;
import com.badlogic.gdx.scenes.scene2d.utils.Align;

public class InGameMenuLayer extends AbstractLayer {
	private Image background;
	private Label pauseLabel;
	private Label questionLabel;

	public InGameMenuLayer() {
		super();
		GameConfiguration configuration = GameConfiguration.getInstance();
		CommonAssetManager manager = CommonAssetManager.getInstance();

		Pixmap pixmap = new Pixmap(LevelScreen.STAGE_WIDTH,
				LevelScreen.STAGE_HEIGHT, Format.RGBA8888);
		pixmap.setColor(0, 0, 0, 0.8f);
		pixmap.fill();
		Texture bgTexture = new Texture(pixmap);

		this.background = new Image(bgTexture);

		addActor(this.background);

		BitmapFont messageFont = manager.get(
				configuration.convertPath(configuration.getCurrentMod()
						.getMenuConfig().getCharacterNameFont()),
				BitmapFont.class);

		LabelStyle labelStyle = new LabelStyle(messageFont, new Color(1, 1, 1,
				1));

		this.pauseLabel = new Label("", labelStyle);
		this.pauseLabel.setAlignment(Align.center);
		this.pauseLabel.setPosition(LevelScreen.STAGE_WIDTH / 2, 350);
		addActor(this.pauseLabel);

		this.pauseLabel.setText("Pause");

		this.questionLabel = new Label("", labelStyle);
		this.questionLabel.setAlignment(Align.center);
		this.questionLabel.setPosition(LevelScreen.STAGE_WIDTH / 2, 250);
		addActor(this.questionLabel);

		this.questionLabel.setText("Quit game?");
	}

}
